<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div></div>
    <script>
        var arr = ['height', 'width', 'backgroundColor']
        var set = ['100px', '100px', 'skyblue']
        var elem = document.querySelector('div')
        function setStyle(elem, arr, set) {
            set.forEach((v, index) => elem.style[arr[index]] = v);
        }
        setStyle(elem, arr, set)
    </script>
</body>

</html>